<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="__PUBLIC__/user/css/BasicStyle.css" rel="stylesheet"
	type="text/css">
<link href="__PUBLIC__/user/css/CommonStyle.css" rel="stylesheet"
	type="text/css">
<link href="__PUBLIC__/user/css/NavigationMasterPage.css"
	rel="stylesheet" type="text/css">
<link href="__PUBLIC__/user/css/AccountMasterPage.css" rel="Stylesheet"
	type="text/css">
<script src="__PUBLIC__/user/js/jquery-1.9.1.min.js"
	type="text/javascript"></script>
<script language="javascript" type="text/javascript"
	src="__PUBLIC__/user/js/agent_getpwd.js"></script>
<script language="javascript" type="text/javascript"
	src="__PUBLIC__/user/js/StringFormat.js"></script>
<title>盈彩-合作伙伴忘记密码</title>
<body>
	<div>
		<block name="include"> <include file="User:agent_cooperation_header" /></block>
		<div id="Main">
			<block name="include"> <include file="User:download_left" /></block>
			<div id="Right">
				<form method="post" action="__CONTROLLER__/agent_forget_next"
					 id="form1"  onsubmit="return Forget()">
					<div>
						<div id="register_container">
							<div class="title">取回代理账号密码</div>
							<div class="field">
								<span class="fieldlabel">代理账号</span> <input name="username"
									type="text" id="username"> <span class="fieldredstar">*</span>
								<span class="fielddescription">您的代理账号。</span>
							</div>
							<br class="spacer">
							<div class="field">
								<span class="fieldlabel">手机号码</span> <input name="phone"
									type="text" id="phone"> <span class="fieldredstar">*</span>
								<button type="button" id="gain" style="margin-left: 10px;float:left">获取验证码</button>
							</div>
							<br class="spacer">
							<div class="field">
								<span class="fieldlabel">验证码</span> <input name="code"
									type="text" id="code" style="width: 50px;"><span class="fieldredstar">*</span>
							</div>
							<div id="submitcontainer" >
								<input class="buttonlink" type="submit" value="下一步" id="buttonlink"  style="margin-left: 20px;" >
							</div>

							<br class="spacer">
							<div style="color: red; margin: 20px; line-height: 20px;">
								提示：手机号码为账号注册时填写的号码
							</div> 
						</div>
					</div>
				</form>
			</div>
		</div>
		<block name="include"> <include file="User:footer" /></block>
	</div>
<script type="text/javascript">
	var countdown=60; 
		//发送验证码
			function settime(obj) { //发送验证码倒计时
			    if (countdown == 0) { 
			        $('buttonlink').attr('disabled',false); 
			        //obj.removeattr("disabled"); 
			        obj.text("免费获取验证码");
			        countdown = 60; 
			        return;
			    } else { 
			        obj.attr('disabled',true);
			        obj.text("重新发送(" + countdown + ")");
			        countdown--; 
			    } 
			setTimeout(function() { 
			    settime(obj) }
			    ,1000) 
			}
		$('#gain')
				.click(
						function() {
							var phone = $('#phone').val();
							var username = $('#username').val();
							var agent_em_gs = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
							if (!agent_em_gs.test(phone)) {
								alert("手机格式不正确，请修改!");
							} else {
								$.ajax({
									url : "__APP__/Home/Sms/forget_send_message",
									data : {
										'phone' : phone,'username' : username
									},
									dataType : "TEXT",
									type : "POST",
									success : function(data) {
										if (data == 2) {
											alert("账号绑定的手机号有误!");
										} else if(data == 3){
											alert("短信发送太频繁!");
										}else{
											 var obj = $("#gain");
											settime(obj);
										}
									}
								});
							}
						});
	</script>
</body>
</html>